<div class="course-list course-list-new">
    <div class="row">
        {% for courseSet in courseSets %}
            <div class="col-lg-3 col-md-4 col-xs-6 course-item-wrap">
                <div class="course-item course-sticky-item">
                  {% if courseSet.course is defined %}
                    {% set course = courseSet.course %}
                  {% else %}
                    {% set course = data('PublishedCourseByCourseSet',{ courseSetId: courseSet.id } ) %}
                  {% endif %}
                  {% if is_plugin_installed('Vip') and setting('vip.enabled') and course.vipLevelId|default(0) > 0 %}
                    <span class="tag-vip-free"></span>
                  {% endif %}
                  <div class="course-img">
                    <a {% if ref|default() %} href="{{ path('course_show', {id: courseSet.defaultCourseId,ref:ref}) }}" {% else %} href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" {% endif %} target="_blank">
                      {% if courseSet.discountId > 0 %}
                        {% if courseSet.discount == 0 %}
                          <!-- 限免 -->
                          <span class="tag-discount free"></span>
                        {% else %}
                          <!-- 折扣 -->
                          <span class="tag-discount"></span>
                        {% endif %}
                      {% endif %}
                      {% if courseSet.course.tryLookVideo|default(false) or courseSet.type|default() == 'reservation' or courseSet.type|default() == 'live' or courseSet.serializeMode != 'none'  %}
                        <div class="course-tag clearfix">
                          {% if courseSet.course.tryLookVideo|default(false) %}
                            <span><i class="es-icon es-icon-video color-white"></i>{{'site.badge.try_watch'|trans}}</span>
                          {% endif %}
                          <span class="pull-right">
                            <span class="cd-mr8">{% if courseSet.type|default() == 'reservation' %}
                              {{ 'my.teaching.course_set.reservation'|trans }}
                            {% elseif courseSet.type|default() == 'live' %}
                              {{ 'search.live_courses'|trans }}
                            {% else %}
                              {% if courseSet.serializeMode == 'serialized' %}
                                {{ 'course.status.serialized'|trans }}
                              {% elseif courseSet.serializeMode == 'finished' %}
                                {{ 'course.status.finished'|trans }}
                              {% endif %}
                            {% endif %}</span>
                            <span class="course-tag__dot"></span>
                          </span>
                        </div>
                      {% endif %}
                      {{ lazy_img(filepath(course_set_cover(courseSet, 'large'), 'courseSet.png'), 'img-responsive', courseSet.title|raw) }}
                    </a>
                    {% if courseSet.stickyTime|default('') %}
                      <span class="course-sticky-tag course-sticky-tag--student">{{ 'group.thread.stick_label'|trans }}</span>
                    {% endif %}

                  </div>
                  <div class="course-info">
                    <div class="title">
                      <a class="link-dark" {% if ref|default() %} href="{{ path('course_show', {id: courseSet.defaultCourseId,ref:ref}) }}" {% else %} href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" {% endif %}
                       target="_blank">
                        {{ courseSet.title|raw }}
                      </a>
                    </div>
                    <div class="metas clearfix">
                      {% if setting('course.show_student_num_enabled', '1') == 1  %}
                        <span class="num">
                          {% if setting('course.show_cover_num_mode') == 'studentNum' %}
                            <i class="es-icon es-icon-people"></i>{{ courseSet.studentNum }}
                          {% elseif setting('course.show_cover_num_mode') == 'hitNum' %}
                            <i class="es-icon es-icon-view"></i>{{ courseSet.hitNum }}
                          {% endif %}
                        </span>
                      {% endif %}
                      {% if setting('goods_setting.show_review', '1') == 1 %}
                        <span {% if setting('course.show_student_num_enabled', '1') == 1 %} class="comment" {% endif %}><i class="es-icon es-icon-textsms"></i>{{ courseSet.ratingNum }}</span>
                      {% endif %}
                      {% set course = courseSet.course|default(null) %}
                        {% if course %}
                          {% include 'course/widgets/price.html.twig' with {shows:'price'} %}
                        {% endif %}
                    </div>
                  </div>
                </div>
            </div>
        {% endfor %}
    </div>
</div>